package pos.domain;

public class SubTypeImpl implements SubType{

	private String idSubType;
	private String name;
//	private Type type;
//	private Entity entity;
	
	public SubTypeImpl(){
		super();
	}
	
	public SubTypeImpl(String idSubType, String name, Type type) {
		super();
		this.idSubType = idSubType;
		this.name = name;
//		this.type = type;
//		this.entity = entity;
	}

	public String getId() {
		return idSubType;
	}

	public String getName() {
		return name;
	}

//	public Type getType() {
//		return type;
//	}
//	public Entity getEntity(){
//		return entity;
//	}

	public void setId(String idSubType) {
		this.idSubType = idSubType;
	}

	public void setName(String name) {
		this.name = name;
	}

//	public void setType(Type type) {
//		this.type = type;
//	}
	
//	public void setEntity(Entity entity){
//		this.entity = entity;
//	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((idSubType == null) ? 0 : idSubType.hashCode());
//		result = prime * result + ((type == null) ? 0 : type.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SubTypeImpl other = (SubTypeImpl) obj;
		if (idSubType == null) {
			if (other.idSubType != null)
				return false;
		} else if (!idSubType.equals(other.idSubType))
			return false;
//		if (type == null) {
//			if (other.type != null)
//				return false;
//		} else if (!type.equals(other.type))
//			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	public String toString() {
		return "SubTypeImpl [idSubType=" + idSubType + ", name=" + name
				+ "]";
	}
	
	
}
